Skip to content

fix: link check on wikipedia#5990

Merged
LesnyRumcajs merged 1 commit intomainfrom
fix-link-check-wikipedia
Aug 25, 2025
Merged

fix: link check on wikipedia#5990
LesnyRumcajs merged 1 commit intomainfrom
fix-link-check-wikipedia

Conversation

@LesnyRumcajs
Copy link
Copy Markdown
Member

@LesnyRumcajs LesnyRumcajs commented Aug 25, 2025

Summary of changes

Changes introduced in this pull request:

  • it seems Wikipedia started using some bot protection, effectively causing the link check to fail there. I added the entire domain to exceptions.

https://github.com/ChainSafe/forest/actions/runs/17208198974/job/48813396939

[403] https://en.wikipedia.org/wiki/Memory_paging#Swappiness | Rejected status code (this depends on your "accept" configuration): Forbidden

Reference issue to close (if applicable)

Closes

Other information and links

Change checklist

  • I have performed a self-review of my own code,
  • I have made corresponding changes to the documentation. All new code adheres to the team's documentation standards,
  • I have added tests that prove my fix is effective or that my feature works (if possible),
  • I have made sure the CHANGELOG is up-to-date. All user-facing changes should be reflected in this document.

Summary by CodeRabbit

  • Chores
    • Updated link-checking configuration to exclude wikipedia.org, reducing false positives caused by bot protection (403 errors) during automated link validation.
    • Improves CI reliability for link checks without affecting application functionality.

@LesnyRumcajs LesnyRumcajs requested a review from a team as a code owner August 25, 2025 12:39
@LesnyRumcajs LesnyRumcajs requested review from akaladarshi and hanabi1224 and removed request for a team August 25, 2025 12:39
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Aug 25, 2025

Walkthrough

Added a new exclude entry "wikipedia.org" to .config/lychee.toml with a preceding comment noting bot protection/403 errors. No other files or configurations were changed.

Changes

Cohort / File(s) Summary
Link checker configuration
\.config/lychee.toml
Added comment about bot protection and excluded wikipedia.org in the exclude array.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

Possibly related PRs

Suggested reviewers

  • elmattic
  • hanabi1224

Tip

🔌 Remote MCP (Model Context Protocol) integration is now available!

Pro plan users can now connect to remote MCP servers from the Integrations page. Connect with popular remote MCPs such as Notion and Linear to add more context to your reviews and chats.

✨ Finishing Touches
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix-link-check-wikipedia

🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR/Issue comments)

Type @coderabbitai help to get the list of available commands.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Status, Documentation and Community

  • Visit our Status Page to check the current availability of CodeRabbit.
  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@LesnyRumcajs LesnyRumcajs enabled auto-merge August 25, 2025 12:40
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Nitpick comments (3)
.config/lychee.toml (3)

22-24: Anchor the exclude to the scheme+host to avoid accidental matches in query strings.

As written, the regex fragment "wikipedia.org" can match anywhere in the URL string (including query parameters on other domains), potentially excluding unrelated links. Anchor to the start and host so only Wikipedia links are skipped. Also future-proof the comment with an explicit date.

-  # Bot protection / 403 Forbidden errors
-  "wikipedia.org",
+  # Bot protection / 403 Forbidden errors (added 2025-08-25). Anchor to scheme+host to avoid false positives.
+  "^https?://([a-z0-9-]+\\.)?wikipedia\\.org(/|$)",

22-24: Add a reminder to revisit the exclusion.

This blanket domain exclude trades reliability for coverage. Add a short TODO with context so we remember to re-enable checks if/when Wikipedia relaxes bot protection or lychee gets a first-class workaround.

   # Bot protection / 403 Forbidden errors (added 2025-08-25). Anchor to scheme+host to avoid false positives.
   "^https?://([a-z0-9-]+\\.)?wikipedia\\.org(/|$)",
+  # TODO(ops): Re-evaluate this exclusion quarterly; lift once link checks stop returning 403 in CI.
+  # See CI run: https://github.com/ChainSafe/forest/actions/runs/17208198974/job/48813396939

I can open a tracking issue with a small reminder bot if you want.


22-24: Add exclusion for Wikipedia’s shortlink domain (w.wiki)

We ran an extended scan across documentation and source files (md, mdx, txt, rs, ts, tsx, html, js, jsx, json, yml, yaml) and did not find any existing https://w.wiki/ links. Nonetheless, adding this exclusion will proactively prevent 403 Forbidden errors when Lychee encounters shortlinks in the future.

• File: .config/lychee.toml
• Context: around lines 22–24

Proposed diff:

   # Bot protection / 403 Forbidden errors (added 2025-08-25). Anchor to scheme+host to avoid false positives.
   "^https?://([a-z0-9-]+\.)?wikipedia\.org(/|$)",
+  # Wikipedia shortlinks can 403 under the same bot protection
+  "^https?://w\.wiki/.*",
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between d44ab1a and e0450a4.

📒 Files selected for processing (1)
  • .config/lychee.toml (1 hunks)
🧰 Additional context used
🧠 Learnings (1)
📓 Common learnings
Learnt from: LesnyRumcajs
PR: ChainSafe/forest#5907
File: src/rpc/methods/state.rs:523-570
Timestamp: 2025-08-06T15:44:33.467Z
Learning: LesnyRumcajs prefers to rely on BufWriter's Drop implementation for automatic flushing rather than explicit flush() calls in Forest codebase.
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (9)
  • GitHub Check: tests
  • GitHub Check: tests-release
  • GitHub Check: Build MacOS
  • GitHub Check: Build Ubuntu
  • GitHub Check: cargo-publish-dry-run
  • GitHub Check: Build forest binaries on Linux AMD64
  • GitHub Check: All lint checks
  • GitHub Check: Analyze (rust)
  • GitHub Check: Analyze (go)
🔇 Additional comments (1)
.config/lychee.toml (1)

22-24: Pragmatic fix.

Given CI is blocked by 403s, excluding Wikipedia is a reasonable, low-risk workaround that aligns with how we already treat other bot-protected hosts in this config.

@LesnyRumcajs LesnyRumcajs added this pull request to the merge queue Aug 25, 2025
@elmattic
Copy link
Copy Markdown
Contributor

Thanks! 🙏

Merged via the queue into main with commit 81115f8 Aug 25, 2025
44 checks passed
@LesnyRumcajs LesnyRumcajs deleted the fix-link-check-wikipedia branch August 25, 2025 13:46
@coderabbitai coderabbitai Bot mentioned this pull request Sep 2, 2025
4 tasks
@coderabbitai coderabbitai Bot mentioned this pull request Dec 10, 2025
4 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants